{% extends "base.volt" %}
{% block pageFooter%}
{{ javascript_include("/assets/manage/js/question/add.js", false) }}
{% endblock %}

{% block content %}
    {{ partial("module/left_question") }}
    <div class="col-xs-10">
        <ol class="breadcrumb">
            <li>问答管理</li>
            <li class="active">添加问答</li>
        </ol>
        	<form id="form_add" class="form-horizontal" role="form" method="post" urlList="{{ url.get('question/list') }}" action="" target="ifr_send_file" enctype="multipart/form-data">
            <div class="form-group">
                <label for="activity_intro" class="col-xs-2 control-label">内容</label>
                <div class="col-xs-9">
                	<textarea class="form-control" style="height:150px;" name="question_content" data-rule="required;"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label for="activity_cover" class="col-xs-2 control-label">城市</label>
                <div class="col-xs-9">
                	<select name="city_id" class="form-control">
                		<option value="0">未选择</option>
                		{% for r in city_list %}
                			<option value="{{ r.city_code }}">{{ r.city_name }}</option>
                		{% endfor %}
                	</select>
                </div>
            </div>
            <div class="form-group">
                <label for="activity_cover" class="col-xs-2 control-label">标签</label>
                <div class="col-xs-9">
                	{% for v in tag %}
                     <input class="question_tag" type="checkbox" did="{{v.tag_id}}" value="{{v.tag_id}},{{v.tag_title}}" name="question_tag[]" data-rule="required;"> {{v.tag_title}}
                    {% endfor %}
                </div>
            </div>
            <div class="form-group">
                <label for="question_browsers" class="col-xs-2 control-label">浏览量</label>
                <div class="col-xs-9">
                    <input type="text" class="form-control" id="question_browsers" name="question_browsers" value="{{ info.question_browsers }}" data-rule="required;integer[+0]">
                </div>
            </div>
             <div class="form-group">
                <label for="question_browsers" class="col-xs-2 control-label">图片</label>
                <div class="col-xs-9">
                    <div id="bp_photos_box">
	                    <div class="input-group paddingTB5">
	                        <input type="file" class="form-control" name="q_photos[]">
	                        <div class="input-group-addon bg_red cursor_pointer" onclick="$.bpPhotoDel(this)"><i class="fa fa-times"></i></div>
	                    </div>
	                    <div class="input-group paddingTB5">
	                        <input type="file" class="form-control" name="q_photos[]">
	                        <div class="input-group-addon bg_red cursor_pointer" onclick="$.bpPhotoDel(this)"><i class="fa fa-times"></i></div>
	                    </div>
                	</div>
                	<div>
	                    <p class="help-block pull-left"></p>
	                    <button type="button" id="but_add_photo" class="btn btn-primary btn-sm pull-right"><i class="fa fa-plus"></i></button>
                	</div>
                </div>
            </div>
                <div class="form-group">
                    <label for="activity_cover" class="col-xs-2 control-label">搜索提问者</label>
                    <div class="col-xs-9">
                        <input type="text" class="form-control" name="search_user" >
                    </div>
                </div>
            <div class="form-group">
                <label for="activity_cover" class="col-xs-2 control-label">提问者</label>
                <div class="col-xs-9">                 
                    <select name="user_id" class="form-control">
                    	{% for r in userlist %}
                    		<option value="{{ r.user_id }}">{{ r.user_nickname }}</option>
                    	{% endfor %}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-12 text-center">
                    <button id="btn_save" type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
                </div>
            </div>
        </form>

    </div>
    
    
    
{% endblock %}